export default [
  {
    path: '/user',
    layout: false,
    routes: [
      { path: '/user/login', component: './User/Login' },
      { path: '/user/register', component: './User/Register' }
    ]
  },
  { path: '/', icon: 'home', component: './Index', name: "主页" },
  {
    path: '/generator/add',
    icon: 'plus',
    component: './Generator/Add',
    name: '发布商品',
  },
  {
    path: '/generator/update',
    icon: 'plus',
    component: './Generator/Add',
    name: '修改商品',
    hideInMenu: true,
  },
  {
    path: '/generator/detail/:id',
    icon: 'home',
    component: './Generator/Detail',
    name: '商品详情',
    hideInMenu: true,
  },
  {
    path: '/test/file',
    icon: 'home',
    component: './Test/File',
    name: '文件上传下载测试',
    hideInMenu: true,
  },
  {
    path: '/message',
    icon: 'wechat',
    component: './Message',
    name: '消息',
  },
  {
    path: '/order',
    icon: 'taobao',
    component: './Order/Index',
    name: '订单',
  },
  {
    path: '/order/detail/:id',
    icon: 'taobao',
    component: './Order/Detail',
    name: '订单详情',
    hideInMenu: true,
  },
  {
    path: '/admin',
    icon: 'crown',
    name: "管理页",
    access: 'canAdmin',
    routes: [
      { path: '/admin', redirect: '/admin/userManage' },
      { path: '/admin/userManage', name: '用户管理', component: './Admin/UserManage' },
      { path: '/admin/GoodsManage', name: '商品管理', component: './Admin/GoodsManage' },
      { path: '/admin/GoodsTypeManage', name: '商品类型管理',  component: './Admin/GoodsTypeManage' },
      { path: '/admin/CommonsManage', name: '评论管理',  component: './Admin/CommonsManage' },
      { path: '/admin/ReportsManage', name: '举报管理',  component: './Admin/ReportsManage' },
      { path: '/admin/OrdersManage', name: '订单管理',  component: './Admin/OrdersManage' },
      { component: './404' },
    ],
  },
  { path: '/', redirect: '/welcome' },
  { path: '*', layout: false, component: './404' },
];
